<template>
  <div class="class-gallery">
    <div id="main"></div>
  </div>
</template>
<script>
export default {
  data() {
    return {};
  },
  mounted() {
    // 基于准备好的dom，初始化echarts实例
    var myChart = this.$echarts.init(document.getElementById("main"));
    // 绘制图表
    myChart.setOption({
      title: {
        text: "班級女生人數",
      },
      tooltip: {},
      xAxis: {
        data: ["軟件181", "軟件182", "軟件183", "計算機181", "計算機182", "計算機183"],
      },
      yAxis: {},
      series: [
        {
          name: "女生",
          type: "bar",
          data: [5, 20, 36, 10, 10, 20],
        },
      ],
    });
  },
};
</script>
<style lang="scss">
.class-gallery {
  #main {
    width: 100%;
    height: 600px;
  }
}
</style>